package com.owg.jigsaw.slots;

import com.owg.jigsaw.WBlock;
import com.owg.jigsaw.hierarchy.TypeNode;

import owg.util.data.PField;
import owg.util.data.PFieldList;

public class MultiSlot extends Slot
{
	public final PFieldList<WBlock> children;
	/**
	 * Create a new multi-slot. A multi-slot allows multiple blocks to be attacked in a chain.
	 * @param slotType The type of this slot. The slot will only accept tabs of this type, or tabs that have child types of this type.
	 * @param maxSize The maximum number of slots in this multi-slot. -1 if unlimited.
	 */
	public MultiSlot(TypeNode slotType, int maxSize)
	{
		super(slotType, true);
		children = new PFieldList<>(this, WBlock.class, 0, maxSize);
	}

	@Override
	public PField<WBlock> getChildren()
	{
		return children;
	}
}
